package com.asset.inventory.manager

import com.asset.inventory.model.LocationModel
import com.asset.inventory.model.OrgModel

/**
 * 页面名称：配置信息管理
 * 创建时间  2021/04/10 14:42
 */
object ConfigInfoManager {
    private lateinit var mOrgInfo: MutableList<OrgModel.AvailableUser>
    private lateinit var mLocationInfo: MutableList<LocationModel.LocationData>

    fun saveOrgInfo(orgInfo: MutableList<OrgModel.AvailableUser>){
        mOrgInfo = orgInfo
    }

    fun getOrgInfo(): MutableList<OrgModel.AvailableUser>{
        return mOrgInfo
    }

    fun getUserList(code: String): MutableList<OrgModel.AvailableUser.User>{
        for (org in mOrgInfo){
            if(org.code == code){
                return org.users
            }
        }
        return mutableListOf()
    }

    fun saveLocationInfo(locationInfo: MutableList<LocationModel.LocationData>){
        mLocationInfo = locationInfo
    }

    fun getLocationInfo(): MutableList<LocationModel.LocationData>{
        return mLocationInfo
    }




}